package com.ieheima.demo;

import java.io.*;
import java.nio.charset.Charset;

public class CharClass02 {
    public static void main(String[] args) throws IOException {
        FileWriter fw = new FileWriter("day13\\a.txt", Charset.forName("GBK"));
        String s = "我有一只小毛驴，我从来也不骑！";
        fw.write(s);
        fw.close();
        InputStreamReader isr = new InputStreamReader(
                new FileInputStream("day13\\a.txt"), "GBK");
        OutputStreamWriter osw = new OutputStreamWriter(
                new FileOutputStream("day13\\b.txt"),"utf-8");
        int a;
        while ((a = isr.read()) != -1){
            osw.write((char) a);
        }
        isr.close();
        osw.close();
    }
}
